<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- 将l替换为* -->
    <script>
        var arr = "helloL";
        // 正则表达式
        var reg = /l/ig; // /ig i--忽略大小写，g--全局替换
        console.log(arr.replace(reg,"*"))
    </script>
</body>
</html>